package coderead.tomcat;
/**
 * @Copyright 源码阅读网 http://coderead.cn
 */

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import java.util.Set;

/**
 * @author 鲁班大叔
 * @date 2021
 */
public class ServletConfig implements ServletContainerInitializer {

    public void onStartup(Set<Class<?>> c,
                          ServletContext ctx) {
        ServletRegistration.Dynamic dynamic =
                ctx.addServlet("pingServlet", new PingAction());
        dynamic.addMapping("/ping");
    }
}
